#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int result = QMessageBox::information(ui->pushButton,"对话框标题","这是一个对话框",QMessageBox::Ok | QMessageBox::Save | QMessageBox::Close);
    if(result == QMessageBox::Ok)
        qDebug() << "OK";
    else if(result == QMessageBox::Save)
        qDebug() << "Save";
    else if(result == QMessageBox::Close)
        qDebug() << "Close";

}
